Ext.Loader.setPath('Ext.ux.GridFieldSet',contextPath+"ux/GridFieldSet.js");
Ext.Loader.setPath("Ext.ux.SearchEditGrid",contextPath+"ux/SearchEditGrid.js");
Ext.Loader.setPath("Ext.ux.SingleForm",contextPath+"ux/SingleForm.js");
Ext.define('Ext.ux.MultiTraitTab',{
		extend:'Ext.tab.Panel',
		xtype:'multi_trait_tab',
		requires:[
			'Ext.ux.GridFieldSet',
			"Ext.ux.SearchEditGrid",
			"Ext.ux.SingleForm",
			'metaLoader'
		],
		bodyPadding: 15,
		scrollable:true,
		initComponent:function(){
			var me=this,metaData=this.metaData,
			traitMetaIds=this.traitMetaIds,
			refMetaMap=metaData["refMetaMap"];
			globalId=this.globalId,items=this.items=[];
			Ext.iterate(traitMetaIds,function(traitMetaId,i){
				var refMeta=refMetaMap[traitMetaId];
				if(!refMeta){
					refMeta=metaLoader.getMetaById(traitMetaId);
					refMetaMap[traitMetaId]=refMeta;
				}
				var attrs=refMeta["attrs"],
				traitXType=attrs["xtype"],
				tab={
						xtype:traitXType,
						globalId:globalId,
						title:refMeta["text"],
						mainMetaId:traitMetaId,
						metaData:metaData
				};
				items.push(tab);
			});
			this.callParent();
		}
		
});

